package com.sky.service.impl;

import com.sky.constant.MessageConstant;
import com.sky.mapper.ShopStatusMapper;
import io.swagger.models.auth.In;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;

@Service
public class ShopStatus implements com.sky.service.ShopStatus {
    @Autowired
    ShopStatusMapper shopStatusMapper;

    /**
     * 获取店铺的状态
     *
     * @return
     */
    @Override
    public Integer getStatus() {
        Integer integer = shopStatusMapper.selectStatus();
        return integer;
    }

    /**
     * 设置员工状态
     */
    @Override
    public void setStatus(Integer status) {
        //获得更新人id
        Long ID = MessageConstant.THREAD_LOCAL;
        //获得更新时间
        LocalDateTime now = LocalDateTime.now();

        shopStatusMapper.setStatus(status,ID, now);
    }
}
